import Vue from 'vue'
import Router from 'vue-router'

import Login from "@/pages/Login"
import Home from "@/pages/Home"
import EditPost from "@/pages/EditPost"
import PostList from "@/pages/PostList"

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      name: 'homePage',
      component: Home,
      meta: "首页",
      children: [{
          path: "editpost",
          name: "editPostPage",
          component: EditPost,
          meta: "编辑文章"
        },
        {
          path: "postlist",
          name: "postListPage",
          component: PostList,
          meta: "文章列表"
        }
      ]
    },
    {
      path: "/login",
      name: "loginPage",
      component: Login
    }
  ]
})
